<?php $this->headTitle($this->headtitle,'SET'); ?>
<div class="container">
	<?php if(!empty($this->alert)):?>
	<div class="alert alert-<?php echo $this->alertType; ?>">
	<button class="close" data-dismiss="alert" type="button">×</button>
	<?php 	echo $this->alert; ?>
	</div>
	<?php endif;?>
	<?php 
		if($this->object != null){
	?>
	<div class="row">
		<!-- images + object infos + comments -->
		<div class="span8">
			<div class="row">
				<!-- images -->
				<div class="span8">
					<div class="row">
						<?php 	
						foreach ($this->object->images as $image)
						{
						?>
						<div class="span2">
							<a href="#myModal" data-toggle="modal">
							<img src="<?php echo $this->baseUrl('img/object/'.$image->url);?>" class="img-rounded" style="width: 140px; height: 140px;">
							</a>
						</div>
						<?php
						} 
						?>
					</div><br>
				</div>
				<!-- object infos -->
				<div class="span8">
					<div class="thumbnail">
						
						<div class="photoContainer">
							<img class="img-rounded" data-src="holder.js/140x140" alt="140x140" style="width: 100px; height: 90px;" src="">
						</div>
						<div class="titleOfferBlock">
							<h1><?php echo $this->object->name; ?></h1>
							<small><?php echo ($this->offer) ? $this->translate($this->offer->classe) : "" ?> <?php echo ($this->address) ? " - ".$this->address->city : "" ?></small>
						</div>
<!-- 						specified bloc for each object -->
						<div class="infoBar">
							    <div class="input-prepend input-append">
								    <span class="add-on"><?php echo $this->object->model; ?>, <?php echo $this->object->brand; ?></span>
								    <span class="add-on"><?php echo $this->object->processor; ?></span>
								    <span class="add-on"><?php echo $this->object->ram; ?></span>
							    </div>
							    <div class="input-prepend input-append">
								    <span class="add-on"><?php echo $this->object->hdd; ?></span>
								    <span class="add-on"><?php echo $this->object->videocard; ?></span>
								    <span class="add-on"><?php echo $this->object->os; ?></span>
								    <span class="add-on"><?php echo $this->object->screensize; ?>"</span>
							    </div>
						</div>
<!-- 						specified bloc for each object -->
						<div class="detail phrases">
							<p><?php echo $this->object->description; ?></p>
						</div>
						
					</div><br>
				</div>
				
				<div class="span8">
					<div class="thumbnail">
					    <div id="disqus_thread"></div>
					    <script type="text/javascript">
					        /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
					        var disqus_shortname = 'driyou'; // required: replace example with your forum shortname
					
					        /* * * DON'T EDIT BELOW THIS LINE * * */
					        (function() {
					            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
					            dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
					            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
					        })();
					    </script>
					    <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
					    <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
					    
					</div>
				</div>
			</div>
			
		</div>
		<!-- map + owner infos -->
		<div class="span4">
			<div class="row">
				<!-- owner infos -->
				<div class="span4">
					<div class="thumbnail">
						<div class="headBlock">
							<?php if($this->activeOffer){?>
						    <div class="btn-group">
							    <a class="btn btn-primary" href="#">€ Offer</a>
							    <a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
							    <ul class="dropdown-menu">
								    <li><a href="<?php echo $this->saleLink; ?>"><i class="icon-shopping-cart"></i> <?php echo $this->translate('Sale');?></a></li>
								    <li><a href="<?php echo $this->rentLink; ?>"><i class="icon-shopping-cart"></i> <?php echo $this->translate('Rent');?></a></li>
							    </ul>
						    </div>
							<?php }?>
						<?php if($this->offer != null){?>
							<h2><?php echo $this->offer->price; ?> <?php echo $this->offer->price_currency; ?></h2>
						<?php }?>
						</div>
						
						
						<?php if($this->offer != null){?>
						<div class="descriptionContainer">
						<?php echo $this->translate('Offer description:');?> <p><?php echo $this->offer->description; ?></p>
						</div>
						
						
						
						
						<div class="resultFooter">
							<p>
							<?php echo $this->translate($this->offerType." "); ?> <?php if($this->isRent == true){ echo $this->translate('by')." ".$this->offer->period; } ?>
							<?php echo $this->translate('published');?> <?php $time =  $this->timeSince(strtotime($this->offer->start_date)); echo $this->translate('%1$s %2$s ago', $time['nb'] ,$time['text']); ?> 
							</p>
							<div class="btn-group dropdown">
								<button class="btn btn-info dropdown-toggle" data-toggle="dropdown">
								<?php echo $this->translate('Message');?>
								<span class="caret"></span>
								</button>
								<div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">
									<?php echo $this->form; ?>
								</div>
							</div>
						</div>
						<div class="avatarOfferContainer">
							<img src="<?php echo $this->baseUrl('img/profil/'.$this->objectOwner->avatar);?>" class="img-polaroid" style="width: 60px; height: 60px;">
						</div>
						<?php }?>
					</div><br>
				</div>
				<!-- map -->
				<?php if($this->address != null){?>
				<div class="span4">
					<div class="thumbnail">
						<?php  echo $this->action('index', 'map', null, array('id_address' => $this->address->addressId));  ?>
					</div>
				</div>
				<?php } ?>
			</div>
		</div>
	</div>
	<div id="myModal" class="modal hide fade" tabindex="-1">
		<div class="modal-header">
		</div>
		<div id="myCarousel" class="carousel slide">
		    <!-- Carousel items -->
		    <div class="carousel-inner">
		<?php 	
		$active = 'active ';
				foreach ($this->object->images as $image)
				{
					
		?>
			<div class="<?php echo $active; ?>item"><img alt="#" src="<?php echo $this->baseUrl('img/object/'.$image->url);?>"></div>
		<?php 
					if($active == 'active ')
						$active = '';
				}
		?>
		    
		    
		    </div>
		    <!-- Carousel nav -->
		    <a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
		    <a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
		</div>
	</div>
	
	<?php 
			
		}
	?>
	
</div>